using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VKPGAR
    {
        public DataRow Convert2KPGAR(DataRow dwInput, string ITXDBVERSION, bool IsConvert = false)
        {
            DataSet SResult = new DataSet();
            SResult = QueryKPGAR(dwInput, 0);
            DataRow dwReturn = null;
            if (SResult.Tables[0].Rows.Count > 0)
            {
                dwReturn = SResult.Tables[0].Rows[0];
            }
            else
            {
                dwReturn = SResult.Tables[0].NewRow();
            }
            switch (ITXDBVERSION)
            {
                case "YGR":
                    #region=========
         dwReturn["KPGMANDANT"] = " ".PadRight(2 ); 
         dwReturn["KPGKUNDNR"] = " ".PadRight(8 ); 
         dwReturn["KPGAKKREDNR"] = " ".PadRight(20 ); 
         dwReturn["KPGCLOSED"] = " ".PadRight(1 ); 
         dwReturn["KPGEKON"] = " ".PadRight(8 ); 
         dwReturn["KPGBIC"] = " ".PadRight(11 ); 
         dwReturn["KPGGBIC"] = " ".PadRight(11 ); 
         dwReturn["KPGGIBAN"] = " ".PadRight(34 ); 
         dwReturn["KPGGARANTYP"] = " ".PadRight(1 ); 
         dwReturn["KPGGUELTVON"] = " ".PadRight(0 ); 
         dwReturn["KPGGUELTBIS"] = " ".PadRight(0 ); 
         dwReturn["KPGLIEFVON"] = " ".PadRight(0 ); 
         dwReturn["KPGLIEFBIS"] = " ".PadRight(0 ); 
         dwReturn["KPGBETRAG"] = " ".PadRight(11 ); 
         dwReturn["KPGWAEHRSL"] = " ".PadRight(3 ); 
         dwReturn["KPGPROZPLU"] = " ".PadRight(0 ); 
         dwReturn["KPGPROZMIN"] = " ".PadRight(0 ); 
         dwReturn["KPGTEILVERL"] = " ".PadRight(1 ); 
         dwReturn["KPGLIEFBED"] = " ".PadRight(3 ); 
         dwReturn["KPGZLAND"] = " ".PadRight(3 ); 
         dwReturn["KPGZPLZ"] = " ".PadRight(12 ); 
         dwReturn["KPGZORT"] = " ".PadRight(40 ); 
         dwReturn["KPGSNAME1"] = " ".PadRight(40 ); 
         dwReturn["KPGSNAME2"] = " ".PadRight(40 ); 
         dwReturn["KPGSZUSATZ"] = " ".PadRight(40 ); 
         dwReturn["KPGSSTRASSE"] = " ".PadRight(40 ); 
         dwReturn["KPGSLAND"] = " ".PadRight(3 ); 
         dwReturn["KPGSPLZ"] = " ".PadRight(12 ); 
         dwReturn["KPGSORT"] = " ".PadRight(40 ); 
         dwReturn["KPGBNAME1"] = " ".PadRight(40 ); 
         dwReturn["KPGBNAME2"] = " ".PadRight(40 ); 
         dwReturn["KPGBZUSATZ"] = " ".PadRight(40 ); 
         dwReturn["KPGBSTRASSE"] = " ".PadRight(40 ); 
         dwReturn["KPGBLAND"] = " ".PadRight(3 ); 
         dwReturn["KPGBPLZ"] = " ".PadRight(12 ); 
         dwReturn["KPGBORT"] = " ".PadRight(40 ); 
         dwReturn["KPGDOCTYP1"] = " ".PadRight(1 ); 
         dwReturn["KPGDOCANZ1"] = " ".PadRight(2 ); 
         dwReturn["KPGDOCTYP2"] = " ".PadRight(1 ); 
         dwReturn["KPGDOCANZ2"] = " ".PadRight(2 ); 
         dwReturn["KPGDOCTYP3"] = " ".PadRight(1 ); 
         dwReturn["KPGDOCANZ3"] = " ".PadRight(2 ); 
         dwReturn["KPGDOCTYP4"] = " ".PadRight(1 ); 
         dwReturn["KPGDOCANZ4"] = " ".PadRight(2 ); 
         dwReturn["KPGDOCTYP5"] = " ".PadRight(1 ); 
         dwReturn["KPGDOCANZ5"] = " ".PadRight(2 ); 
         dwReturn["KPGDOCTYP6"] = " ".PadRight(1 ); 
         dwReturn["KPGDOCANZ6"] = " ".PadRight(2 ); 
         dwReturn["KPGDOCTYP7"] = " ".PadRight(1 ); 
         dwReturn["KPGDOCANZ7"] = " ".PadRight(2 ); 
         dwReturn["KPGDOCTYP8"] = " ".PadRight(1 ); 
         dwReturn["KPGDOCANZ8"] = " ".PadRight(2 ); 
         dwReturn["KPGDOCTYP9"] = " ".PadRight(1 ); 
         dwReturn["KPGDOCANZ9"] = " ".PadRight(2 ); 
         dwReturn["KPGDOCTYP10"] = " ".PadRight(1 ); 
         dwReturn["KPGDOCANZ10"] = " ".PadRight(2 ); 
         dwReturn["KPGWVTERM"] = " ".PadRight(0 ); 
         dwReturn["KPGGENEHM"] = " ".PadRight(1 ); 
         dwReturn["KPGFAKT"] = " ".PadRight(11 ); 
         dwReturn["KPGFREIG"] = " ".PadRight(11 ); 
         dwReturn["KPGFILLER"] = " ".PadRight(48 ); 
         dwReturn["KPGAENZL"] = " ".PadRight(0 ); 
         dwReturn["KPGAENB"] = " ".PadRight(8 ); 
         dwReturn["KPGAEND"] = " ".PadRight(0 ); 
         dwReturn["KPGNEUB"] = " ".PadRight(8 ); 
         dwReturn["KPGNEUD"] = " ".PadRight(0 ); 
                    #endregion
                    break;
                case "JLT":

                    break;
                default:

                    break;
            }
            if (IsConvert)
            {
                foreach (DataColumn cm in dwInput.Table.Columns)
                {
                    if (dwInput[cm.ColumnName].ToString() == "")
                        continue;
                    if (dwReturn.Table.Columns.Contains(cm.ColumnName))
                    {
                        dwReturn[cm.ColumnName] = dwInput[cm.ColumnName];
                    }
                }
            }
            return dwReturn;
        }
        public void MapKPGAR(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }
        public void SaveKPGAR(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QueryKPGAR(dwData);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }
            MapKPGAR(ref dwLocal, dwData);

            if (!flgExist)
            {

                InsertKPGAR(dwLocal, ITXDBVERSION);
            }
            UpdateKPGAR(dwLocal);
        }
        public void InsertKPGAR(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (ITXDBVERSION)
            {
                case "YGR":
                    or1.CommandText = "INSERT INTO KPGAR(VAKBMANDANT, VAKBKOLL, VAKBART, VAKBKUNDNR, VAKBFARBE, VAKBKDARTNR, VAKBKDARTBEZ, VAKBKDFARBNR, VAKBANDRUCK, VAKBMEGEW, VAKBMENGEH, VAKBGEWVON, VAKBGEWBIS, VAKBGEWCA, VAKBGEWFKT, VAKBGEWGRP, VAKBMEGFKT, VAKBMEGGRP, VAKBAENDZL, VAKBAENDBEN, VAKBAENDDAT, VAKBNEUBEN, VAKBNEUDAT, VAKBFILLER)"
                        + " VALUES (:VAKBMANDANT, :VAKBKOLL, :VAKBART, :VAKBKUNDNR, :VAKBFARBE, '                         ', '                         ', '                             ', ' ', '   ', '   ', 0, 0, ' ', '000000000000', ' ', '000000000000', ' ', 0, '        ', '000000', '        ', '      ', '                                          ')";
                    or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                //VAFMANDANT VAFKOLL VAFART VAFFARBE VAFBEZ VAFFFARBE

            }
            
            Connect2Proxy(or1);
        }
        public DataSet QueryKPGAR(DataRow dwData, int option = 1)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM KPGAR WHERE  ROWNUM<2 ";
                    break;
              
                case 99:
                    or1.CommandText = "SELECT * FROM KPGAR  WHERE ROWNUM<50";
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "KPGAR";
            Return = Result;
            return Return;
        }
        public void DeleteKPGAR(DataRow dwData, int option = 1)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM KPGAR   WHERE  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                     or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        } 
      
        public void UpdateKPGAR(DataRow dwData, string ITXDBVERSION = "50.24", int option = 1)
        {
            OracleCommand or1;
            DataSet Result = new DataSet();
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    #region====Command==== 
                    or1.CommandText = "UPDATE KPGAR SET "
                    +"KPGMANDANT= :KPGMANDANT,"
                    +"KPGKUNDNR= :KPGKUNDNR,"
                    +"KPGAKKREDNR= :KPGAKKREDNR,"
                    +"KPGCLOSED= :KPGCLOSED,"
                    +"KPGEKON= :KPGEKON,"
                    +"KPGBIC= :KPGBIC,"
                    +"KPGGBIC= :KPGGBIC,"
                    +"KPGGIBAN= :KPGGIBAN,"
                    +"KPGGARANTYP= :KPGGARANTYP,"
                    +"KPGGUELTVON= :KPGGUELTVON,"
                    +"KPGGUELTBIS= :KPGGUELTBIS,"
                    +"KPGLIEFVON= :KPGLIEFVON,"
                    +"KPGLIEFBIS= :KPGLIEFBIS,"
                    +"KPGBETRAG= :KPGBETRAG,"
                    +"KPGWAEHRSL= :KPGWAEHRSL,"
                    +"KPGPROZPLU= :KPGPROZPLU,"
                    +"KPGPROZMIN= :KPGPROZMIN,"
                    +"KPGTEILVERL= :KPGTEILVERL,"
                    +"KPGLIEFBED= :KPGLIEFBED,"
                    +"KPGZLAND= :KPGZLAND,"
                    +"KPGZPLZ= :KPGZPLZ,"
                    +"KPGZORT= :KPGZORT,"
                    +"KPGSNAME1= :KPGSNAME1,"
                    +"KPGSNAME2= :KPGSNAME2,"
                    +"KPGSZUSATZ= :KPGSZUSATZ,"
                    +"KPGSSTRASSE= :KPGSSTRASSE,"
                    +"KPGSLAND= :KPGSLAND,"
                    +"KPGSPLZ= :KPGSPLZ,"
                    +"KPGSORT= :KPGSORT,"
                    +"KPGBNAME1= :KPGBNAME1,"
                    +"KPGBNAME2= :KPGBNAME2,"
                    +"KPGBZUSATZ= :KPGBZUSATZ,"
                    +"KPGBSTRASSE= :KPGBSTRASSE,"
                    +"KPGBLAND= :KPGBLAND,"
                    +"KPGBPLZ= :KPGBPLZ,"
                    +"KPGBORT= :KPGBORT,"
                    +"KPGDOCTYP1= :KPGDOCTYP1,"
                    +"KPGDOCANZ1= :KPGDOCANZ1,"
                    +"KPGDOCTYP2= :KPGDOCTYP2,"
                    +"KPGDOCANZ2= :KPGDOCANZ2,"
                    +"KPGDOCTYP3= :KPGDOCTYP3,"
                    +"KPGDOCANZ3= :KPGDOCANZ3,"
                    +"KPGDOCTYP4= :KPGDOCTYP4,"
                    +"KPGDOCANZ4= :KPGDOCANZ4,"
                    +"KPGDOCTYP5= :KPGDOCTYP5,"
                    +"KPGDOCANZ5= :KPGDOCANZ5,"
                    +"KPGDOCTYP6= :KPGDOCTYP6,"
                    +"KPGDOCANZ6= :KPGDOCANZ6,"
                    +"KPGDOCTYP7= :KPGDOCTYP7,"
                    +"KPGDOCANZ7= :KPGDOCANZ7,"
                    +"KPGDOCTYP8= :KPGDOCTYP8,"
                    +"KPGDOCANZ8= :KPGDOCANZ8,"
                    +"KPGDOCTYP9= :KPGDOCTYP9,"
                    +"KPGDOCANZ9= :KPGDOCANZ9,"
                    +"KPGDOCTYP10= :KPGDOCTYP10,"
                    +"KPGDOCANZ10= :KPGDOCANZ10,"
                    +"KPGWVTERM= :KPGWVTERM,"
                    +"KPGGENEHM= :KPGGENEHM,"
                    +"KPGFAKT= :KPGFAKT,"
                    +"KPGFREIG= :KPGFREIG,"
                    +"KPGFILLER= :KPGFILLER,"
                    +"KPGAENZL= :KPGAENZL,"
                    +"KPGAENB= :KPGAENB,"
                    +"KPGAEND= :KPGAEND,"
                    +"KPGNEUB= :KPGNEUB,"
                    +"KPGNEUD= :KPGNEUD,"
                        + " WHERE  "
                        + "  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                    #endregion

                    #region====Parameters====
          or1.Parameters.Add("KPGMANDANT", OracleType.NVarChar).Value = dwData["KPGMANDANT"].ToString(); 
          or1.Parameters.Add("KPGKUNDNR", OracleType.NVarChar).Value = dwData["KPGKUNDNR"].ToString(); 
          or1.Parameters.Add("KPGAKKREDNR", OracleType.NVarChar).Value = dwData["KPGAKKREDNR"].ToString(); 
          or1.Parameters.Add("KPGCLOSED", OracleType.NVarChar).Value = dwData["KPGCLOSED"].ToString(); 
          or1.Parameters.Add("KPGEKON", OracleType.NVarChar).Value = dwData["KPGEKON"].ToString(); 
          or1.Parameters.Add("KPGBIC", OracleType.NVarChar).Value = dwData["KPGBIC"].ToString(); 
          or1.Parameters.Add("KPGGBIC", OracleType.NVarChar).Value = dwData["KPGGBIC"].ToString(); 
          or1.Parameters.Add("KPGGIBAN", OracleType.NVarChar).Value = dwData["KPGGIBAN"].ToString(); 
          or1.Parameters.Add("KPGGARANTYP", OracleType.NVarChar).Value = dwData["KPGGARANTYP"].ToString(); 
          or1.Parameters.Add("KPGGUELTVON", OracleType.NVarChar).Value = dwData["KPGGUELTVON"].ToString(); 
          or1.Parameters.Add("KPGGUELTBIS", OracleType.NVarChar).Value = dwData["KPGGUELTBIS"].ToString(); 
          or1.Parameters.Add("KPGLIEFVON", OracleType.NVarChar).Value = dwData["KPGLIEFVON"].ToString(); 
          or1.Parameters.Add("KPGLIEFBIS", OracleType.NVarChar).Value = dwData["KPGLIEFBIS"].ToString(); 
          or1.Parameters.Add("KPGBETRAG", OracleType.NVarChar).Value = dwData["KPGBETRAG"].ToString(); 
          or1.Parameters.Add("KPGWAEHRSL", OracleType.NVarChar).Value = dwData["KPGWAEHRSL"].ToString(); 
          or1.Parameters.Add("KPGPROZPLU", OracleType.NVarChar).Value = dwData["KPGPROZPLU"].ToString(); 
          or1.Parameters.Add("KPGPROZMIN", OracleType.NVarChar).Value = dwData["KPGPROZMIN"].ToString(); 
          or1.Parameters.Add("KPGTEILVERL", OracleType.NVarChar).Value = dwData["KPGTEILVERL"].ToString(); 
          or1.Parameters.Add("KPGLIEFBED", OracleType.NVarChar).Value = dwData["KPGLIEFBED"].ToString(); 
          or1.Parameters.Add("KPGZLAND", OracleType.NVarChar).Value = dwData["KPGZLAND"].ToString(); 
          or1.Parameters.Add("KPGZPLZ", OracleType.NVarChar).Value = dwData["KPGZPLZ"].ToString(); 
          or1.Parameters.Add("KPGZORT", OracleType.NVarChar).Value = dwData["KPGZORT"].ToString(); 
          or1.Parameters.Add("KPGSNAME1", OracleType.NVarChar).Value = dwData["KPGSNAME1"].ToString(); 
          or1.Parameters.Add("KPGSNAME2", OracleType.NVarChar).Value = dwData["KPGSNAME2"].ToString(); 
          or1.Parameters.Add("KPGSZUSATZ", OracleType.NVarChar).Value = dwData["KPGSZUSATZ"].ToString(); 
          or1.Parameters.Add("KPGSSTRASSE", OracleType.NVarChar).Value = dwData["KPGSSTRASSE"].ToString(); 
          or1.Parameters.Add("KPGSLAND", OracleType.NVarChar).Value = dwData["KPGSLAND"].ToString(); 
          or1.Parameters.Add("KPGSPLZ", OracleType.NVarChar).Value = dwData["KPGSPLZ"].ToString(); 
          or1.Parameters.Add("KPGSORT", OracleType.NVarChar).Value = dwData["KPGSORT"].ToString(); 
          or1.Parameters.Add("KPGBNAME1", OracleType.NVarChar).Value = dwData["KPGBNAME1"].ToString(); 
          or1.Parameters.Add("KPGBNAME2", OracleType.NVarChar).Value = dwData["KPGBNAME2"].ToString(); 
          or1.Parameters.Add("KPGBZUSATZ", OracleType.NVarChar).Value = dwData["KPGBZUSATZ"].ToString(); 
          or1.Parameters.Add("KPGBSTRASSE", OracleType.NVarChar).Value = dwData["KPGBSTRASSE"].ToString(); 
          or1.Parameters.Add("KPGBLAND", OracleType.NVarChar).Value = dwData["KPGBLAND"].ToString(); 
          or1.Parameters.Add("KPGBPLZ", OracleType.NVarChar).Value = dwData["KPGBPLZ"].ToString(); 
          or1.Parameters.Add("KPGBORT", OracleType.NVarChar).Value = dwData["KPGBORT"].ToString(); 
          or1.Parameters.Add("KPGDOCTYP1", OracleType.NVarChar).Value = dwData["KPGDOCTYP1"].ToString(); 
          or1.Parameters.Add("KPGDOCANZ1", OracleType.NVarChar).Value = dwData["KPGDOCANZ1"].ToString(); 
          or1.Parameters.Add("KPGDOCTYP2", OracleType.NVarChar).Value = dwData["KPGDOCTYP2"].ToString(); 
          or1.Parameters.Add("KPGDOCANZ2", OracleType.NVarChar).Value = dwData["KPGDOCANZ2"].ToString(); 
          or1.Parameters.Add("KPGDOCTYP3", OracleType.NVarChar).Value = dwData["KPGDOCTYP3"].ToString(); 
          or1.Parameters.Add("KPGDOCANZ3", OracleType.NVarChar).Value = dwData["KPGDOCANZ3"].ToString(); 
          or1.Parameters.Add("KPGDOCTYP4", OracleType.NVarChar).Value = dwData["KPGDOCTYP4"].ToString(); 
          or1.Parameters.Add("KPGDOCANZ4", OracleType.NVarChar).Value = dwData["KPGDOCANZ4"].ToString(); 
          or1.Parameters.Add("KPGDOCTYP5", OracleType.NVarChar).Value = dwData["KPGDOCTYP5"].ToString(); 
          or1.Parameters.Add("KPGDOCANZ5", OracleType.NVarChar).Value = dwData["KPGDOCANZ5"].ToString(); 
          or1.Parameters.Add("KPGDOCTYP6", OracleType.NVarChar).Value = dwData["KPGDOCTYP6"].ToString(); 
          or1.Parameters.Add("KPGDOCANZ6", OracleType.NVarChar).Value = dwData["KPGDOCANZ6"].ToString(); 
          or1.Parameters.Add("KPGDOCTYP7", OracleType.NVarChar).Value = dwData["KPGDOCTYP7"].ToString(); 
          or1.Parameters.Add("KPGDOCANZ7", OracleType.NVarChar).Value = dwData["KPGDOCANZ7"].ToString(); 
          or1.Parameters.Add("KPGDOCTYP8", OracleType.NVarChar).Value = dwData["KPGDOCTYP8"].ToString(); 
          or1.Parameters.Add("KPGDOCANZ8", OracleType.NVarChar).Value = dwData["KPGDOCANZ8"].ToString(); 
          or1.Parameters.Add("KPGDOCTYP9", OracleType.NVarChar).Value = dwData["KPGDOCTYP9"].ToString(); 
          or1.Parameters.Add("KPGDOCANZ9", OracleType.NVarChar).Value = dwData["KPGDOCANZ9"].ToString(); 
          or1.Parameters.Add("KPGDOCTYP10", OracleType.NVarChar).Value = dwData["KPGDOCTYP10"].ToString(); 
          or1.Parameters.Add("KPGDOCANZ10", OracleType.NVarChar).Value = dwData["KPGDOCANZ10"].ToString(); 
          or1.Parameters.Add("KPGWVTERM", OracleType.NVarChar).Value = dwData["KPGWVTERM"].ToString(); 
          or1.Parameters.Add("KPGGENEHM", OracleType.NVarChar).Value = dwData["KPGGENEHM"].ToString(); 
          or1.Parameters.Add("KPGFAKT", OracleType.NVarChar).Value = dwData["KPGFAKT"].ToString(); 
          or1.Parameters.Add("KPGFREIG", OracleType.NVarChar).Value = dwData["KPGFREIG"].ToString(); 
          or1.Parameters.Add("KPGFILLER", OracleType.NVarChar).Value = dwData["KPGFILLER"].ToString(); 
          or1.Parameters.Add("KPGAENZL", OracleType.NVarChar).Value = dwData["KPGAENZL"].ToString(); 
          or1.Parameters.Add("KPGAENB", OracleType.NVarChar).Value = dwData["KPGAENB"].ToString(); 
          or1.Parameters.Add("KPGAEND", OracleType.NVarChar).Value = dwData["KPGAEND"].ToString(); 
          or1.Parameters.Add("KPGNEUB", OracleType.NVarChar).Value = dwData["KPGNEUB"].ToString(); 
          or1.Parameters.Add("KPGNEUD", OracleType.NVarChar).Value = dwData["KPGNEUD"].ToString(); 
                    #endregion
                    break; 
                default:
                    break;
            }


            Connect2Proxy(or1);
        }
    }
}
